1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module sourceview.CompletionCell;
26 
27 private import gdk.PaintableIF;
28 private import gio.IconIF;
29 private import glib.Str;
30 private import gobject.ObjectG;
31 private import gtk.AccessibleIF;
32 private import gtk.AccessibleT;
33 private import gtk.BuildableIF;
34 private import gtk.BuildableT;
35 private import gtk.ConstraintTargetIF;
36 private import gtk.ConstraintTargetT;
37 private import gtk.Widget;
38 private import pango.PgAttributeList;
39 private import sourceview.c.functions;
40 public  import sourceview.c.types;
41 
42 
43 /**
44  * Widget for single cell of completion proposal.
45  * 
46  * The `GtkSourceCompletionCell` widget provides a container to display various
47  * types of information with the completion display.
48  * 
49  * Each proposal may consist of multiple cells depending on the complexity of
50  * the proposal. For example, programming language proposals may contain a cell
51  * for the "left-hand-side" of an operation along with the "typed-text" for a
52  * function name and "parameters". They may also optionally set an icon to
53  * signify the kind of result.
54  * 
55  * A [iface@CompletionProvider] should implement the
56  * [vfunc@CompletionProvider.display] virtual function to control
57  * how to convert data from their [iface@CompletionProposal] to content for
58  * the `GtkSourceCompletionCell`.
59  */
60 public class CompletionCell : Widget
61 {
62 	/** the main Gtk struct */
63 	protected GtkSourceCompletionCell* gtkSourceCompletionCell;
64 
65 	/** Get the main Gtk struct */
66 	public GtkSourceCompletionCell* getCompletionCellStruct(bool transferOwnership = false)
67 	{
68 		if (transferOwnership)
69 			ownedRef = false;
70 		return gtkSourceCompletionCell;
71 	}
72 
73 	/** the main Gtk struct as a void* */
74 	protected override void* getStruct()
75 	{
76 		return cast(void*)gtkSourceCompletionCell;
77 	}
78 
79 	/**
80 	 * Sets our main struct and passes it to the parent class.
81 	 */
82 	public this (GtkSourceCompletionCell* gtkSourceCompletionCell, bool ownedRef = false)
83 	{
84 		this.gtkSourceCompletionCell = gtkSourceCompletionCell;
85 		super(cast(GtkWidget*)gtkSourceCompletionCell, ownedRef);
86 	}
87 
88 
89 	/** */
90 	public static GType getType()
91 	{
92 		return gtk_source_completion_cell_get_type();
93 	}
94 
95 	/** */
96 	public GtkSourceCompletionColumn getColumn()
97 	{
98 		return gtk_source_completion_cell_get_column(gtkSourceCompletionCell);
99 	}
100 
101 	/**
102 	 * Gets the child #GtkWidget, if any.
103 	 *
104 	 * Returns: a #GtkWidget or %NULL
105 	 */
106 	public Widget getWidget()
107 	{
108 		auto __p = gtk_source_completion_cell_get_widget(gtkSourceCompletionCell);
109 
110 		if(__p is null)
111 		{
112 			return null;
113 		}
114 
115 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) __p);
116 	}
117 
118 	/** */
119 	public void setGicon(IconIF gicon)
120 	{
121 		gtk_source_completion_cell_set_gicon(gtkSourceCompletionCell, (gicon is null) ? null : gicon.getIconStruct());
122 	}
123 
124 	/** */
125 	public void setIconName(string iconName)
126 	{
127 		gtk_source_completion_cell_set_icon_name(gtkSourceCompletionCell, Str.toStringz(iconName));
128 	}
129 
130 	/** */
131 	public void setMarkup(string markup)
132 	{
133 		gtk_source_completion_cell_set_markup(gtkSourceCompletionCell, Str.toStringz(markup));
134 	}
135 
136 	/** */
137 	public void setPaintable(PaintableIF paintable)
138 	{
139 		gtk_source_completion_cell_set_paintable(gtkSourceCompletionCell, (paintable is null) ? null : paintable.getPaintableStruct());
140 	}
141 
142 	/**
143 	 * Sets the text for the column cell. Use %NULL to unset.
144 	 *
145 	 * Params:
146 	 *     text = the text to set or %NULL
147 	 */
148 	public void setText(string text)
149 	{
150 		gtk_source_completion_cell_set_text(gtkSourceCompletionCell, Str.toStringz(text));
151 	}
152 
153 	/** */
154 	public void setTextWithAttributes(string text, PgAttributeList attrs)
155 	{
156 		gtk_source_completion_cell_set_text_with_attributes(gtkSourceCompletionCell, Str.toStringz(text), (attrs is null) ? null : attrs.getPgAttributeListStruct());
157 	}
158 
159 	/** */
160 	public void setWidget(Widget child)
161 	{
162 		gtk_source_completion_cell_set_widget(gtkSourceCompletionCell, (child is null) ? null : child.getWidgetStruct());
163 	}
164 }